/*    */ package com.zimbra.cs.redolog.op;
/*    */ 
/*    */ import com.zimbra.cs.mailbox.Mailbox;
/*    */ import com.zimbra.cs.mailbox.MailboxManager;
/*    */ import com.zimbra.cs.mailbox.MailboxOperation;
/*    */ import com.zimbra.cs.mailbox.Note.Rectangle;
/*    */ import com.zimbra.cs.redolog.RedoLogInput;
/*    */ import com.zimbra.cs.redolog.RedoLogOutput;
/*    */ import java.io.IOException;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class RepositionNote
/*    */   extends RedoableOp
/*    */ {
/*    */   private int mId;
/*    */   private Note.Rectangle mBounds;
/*    */   
/*    */   public RepositionNote()
/*    */   {
/* 38 */     super(MailboxOperation.RepositionNote);
/* 39 */     this.mId = 0;
/*    */   }
/*    */   
/*    */   public RepositionNote(int mailboxId, int id, Note.Rectangle bounds) {
/* 43 */     this();
/* 44 */     setMailboxId(mailboxId);
/* 45 */     this.mId = id;
/* 46 */     this.mBounds = bounds;
/*    */   }
/*    */   
/*    */   protected String getPrintableData() {
/* 50 */     StringBuffer sb = new StringBuffer("id=");
/* 51 */     sb.append(this.mId);
/* 52 */     if (this.mBounds != null)
/* 53 */       sb.append(", bounds=(").append(this.mBounds).append(")");
/* 54 */     return sb.toString();
/*    */   }
/*    */   
/*    */   protected void serializeData(RedoLogOutput out) throws IOException {
/* 58 */     out.writeInt(this.mId);
/* 59 */     out.writeInt(this.mBounds.x);
/* 60 */     out.writeInt(this.mBounds.y);
/* 61 */     out.writeInt(this.mBounds.width);
/* 62 */     out.writeInt(this.mBounds.height);
/*    */   }
/*    */   
/*    */   protected void deserializeData(RedoLogInput in) throws IOException {
/* 66 */     this.mId = in.readInt();
/* 67 */     int x = in.readInt();
/* 68 */     int y = in.readInt();
/* 69 */     int w = in.readInt();
/* 70 */     int h = in.readInt();
/* 71 */     this.mBounds = new Note.Rectangle(x, y, w, h);
/*    */   }
/*    */   
/*    */   public void redo() throws Exception {
/* 75 */     Mailbox mailbox = MailboxManager.getInstance().getMailboxById(getMailboxId());
/* 76 */     mailbox.repositionNote(getOperationContext(), this.mId, this.mBounds);
/*    */   }
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/redolog/op/RepositionNote.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */